package cn.tedu.spring.resource;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class WeiboMapper {
    /**
     * Resource:装配对象或者接口类型的数据
     * 装配规则:
     *      1.根据IoC容器中Spring Bean对象的名称进行装配;
     *      2.未指定名称[name参数],把属性名称作为Spring Bean对象的名称进行装配
     *      3.如果属性名和Bean对象的名称不一致,则根据类型进行匹配
     */
    @Resource(name = "resMapperImpl1")
    private ResMapper resMapper;
//    @Resource
//    private ResMapper resMapperImpl2;

    @Override
    public String toString() {
        return "WeiboMapper{" +
                "resMapper=" + resMapper +
                '}';
    }

}
